<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>FlexTest</title>
  <style>
    html,
    body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      box-sizing: border-box;
    }

    .wapper {
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .posC {
      height: 100px;
      width: 100px;
    }

    @media screen and (min-width: 300px) {
      .posC {
        background-color: lightgreen;
      }
    }

    @media screen and (min-width: 500px) {
      .posC {
        background-color: red;
      }
    }

    @media screen and (min-width: 700px) {
      .posC {
        background-color: blue;
      }
    }
  </style>
</head>

<body>
  <div class="wapper">
    <div class="posC"></div>
  </div>
</body>

</html>